#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qt3d_auto_render)



#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qt3d)
#设置需要链接的模块
set(LinkQt Core Widgets Concurrent 3DCore 3DRender)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core 3DCore)
#设置排除的文件夹
set(EXCLUDE domain qml-qtquicktest)
#寻找指定测试类型的所有测试项，即auto目录下的所有测试项
#find_all(${MODULE} ${TEST_TYPE} TEST_ITEMS)

#如果需要自行添加整合测试项，可以使用如下语句,即添加测试类型(auto、manual)下的目录(支持多级目录)
# set(TEST_ITEMS ${TEST_ITEMS}
#     test1
#     test2
# )
#多级目录
#
message(Qt${QT_VERSION_MAJOR}3DRenderPrivate_DIR=${Qt${QT_VERSION_MAJOR}3DRenderPrivate_DIR})

if(DEFINED Qt${QT_VERSION_MAJOR}3DRenderPrivate_DIR AND NOT "${Qt${QT_VERSION_MAJOR}3DRenderPrivate_DIR}" STREQUAL "")
    list(APPEND TEST_ITEMS
        core/common
        render/entity
        render/renderpass
        render/qgraphicsutils
        render/shader
        render/shaderbuilder
        render/texture
        render/material
        render/vsyncframeadvanceservice
        render/meshfunctors
        render/qattribute
        render/qbuffer
        render/qgeometry
        render/qgeometryrenderer
        render/qlevelofdetail
        render/levelofdetail
        render/buffer
        render/attribute
        render/geometry
        render/geometryrenderer
        render/qcameraselector
        render/qclearbuffers
        render/qframegraphnode
        render/qlayerfilter
        render/qabstractlight
        render/qenvironmentlight
        render/qrenderpassfilter
        render/qrenderstate
        render/qrendertargetselector
        render/qsortpolicy
        render/qrenderstateset
        render/qtechniquefilter
        render/qtextureimagedata
        render/qviewport
        render/framegraphnode
        render/qobjectpicker
        render/objectpicker
        render/ddstextures
        render/shadercache
        render/layerfiltering
        render/filterentitybycomponent
        render/genericlambdajob
        render/qgraphicsapifilter
        render/qrendersurfaceselector
        render/sortpolicy
        render/sceneloader
        render/qsceneloader
        render/qrendertargetoutput
        render/qcameralens
        render/qcomputecommand
        render/loadscenejob
        render/qrendercapture
        render/uniform
        render/qparameter
        render/parameter
        render/qtextureloader
        render/qtextureimage
        render/qabstracttexture
        render/qabstracttextureimage
        render/qrendersettings
        render/texturedatamanager
        render/rendertarget
        render/transform
        render/computecommand
        render/qrendertarget
        render/qdispatchcompute
        render/qtechnique
        render/qeffect
        render/qrenderpass
        render/qfilterkey
        render/effect
        render/filterkey
        render/qmesh
        render/technique
        render/rendercapture
        render/segmentvisitor
        render/trianglevisitor
        render/qmemorybarrier
        render/memorybarrier
        render/qshaderprogram
        render/qshaderprogrambuilder
        render/coordinatereader
        render/framegraphvisitor
        render/armature
        render/skeleton
        render/joint
        render/qproximityfilter
        render/proximityfilter
        render/proximityfiltering
        render/qblitframebuffer
        render/blitframebuffer
        render/qraycaster
        render/raycaster
        render/qscreenraycaster
        render/raycastingjob
        render/qcamera
        render/qray3d
        render/raycasting
        render/trianglesextractor
        render/triangleboundingvolume
        render/filtercompatibletechniquejob
        render/graphicshelpergl3_3
        render/graphicshelpergl3_2
        render/graphicshelpergl2
        render/materialparametergathererjob
        render/textures
        render/renderer
        render/renderviewutils
        render/renderviews
        render/renderqueue
        render/renderviewbuilder
        render/sendrendercapturejob
        render/qmaterial
        render/geometryloaders
        render/picking
        render/boundingsphere
        render/qdefaultmeshes
        render/pickboundingvolumejob
        render/gltfplugins
        render/updatemeshtrianglelistjob
        render/updateshaderdatatransformjob
        render/qscene2d
        render/scene2d
        render/alignedresourcesmanagers-avx
        render/alignedresourcesmanagers-sse
     )

     if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
         message(STATUS "当前系统是 macOS")
     else()
         message(STATUS "当前系统不是 macOS")
         list(APPEND TEST_ITEMS
             render/graphicshelpergl4
         )
     endif()
else()

endif()

# set(EXCLUDE_SRC ${EXCLUDE_SRC}
#      core/common/qbackendnodetester.cpp
#      core/common/qbackendnodetester.h
#  )
#再把TEST_ITEMS传给create_library整合测试项，生成测试库
set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)
#整合测试项，生成测试库，名字当前工程名，即project(tst_qtcharts_auto)中定义的tst_qtcharts_auto
if(DEFINED TEST_ITEMS)
    create_library(${TEST_ITEMS})
endif()
